import os
var args = commandLineParams()
if len(args) == 1:
  var filename = args[0]
  var inputFile = open(filename,fmRead)
  var outputFile = open(filename & "-output.png",fmWrite)

  # 32 bits is based off the .stex header which are trimmed for png
  inputFile.setFilePos(32)
  while not endOfFile(inputFile):
    var char_a = inputFile.readChar()
    outputFile.write(char_a)
  inputFile.close()
  outputFile.close()
else:
  echo "usage: main.exe file.stex"